<template>
  <div class="app-container">
    <el-form ref="form" :model="data" label-width="100px">
      <el-form-item label="id">
        <div>{{data.id}}</div>
      </el-form-item>
      <el-form-item label="警报名称">
        <div>{{data.title}}</div>
      </el-form-item>
      <el-form-item label="警报别称">
        <div>{{data.shortname}}</div>
      </el-form-item>
      <el-form-item label="编号">
        <div>{{data.code}}</div>
      </el-form-item>
      <el-form-item label="警报原因">
        <div>{{data.fdesc}}</div>
      </el-form-item>
      <el-form-item label="解决方案">
        <div>{{data.solution}}</div>
      </el-form-item>
      <el-form-item label="状态">
        <div>{{data.status|statusName()}}</div>
      </el-form-item>
      <el-form-item label="type">
        <div>{{data.type}}</div>
      </el-form-item>
      <el-form-item label="subtype">
        <div>{{data.subtype}}</div>
      </el-form-item>
      <el-form-item label="等级">
        <div>{{data.level}}</div>
      </el-form-item>
      <el-form-item label="titleEn">
        <div>{{data.titleEn}}</div>
      </el-form-item>
      <el-form-item label="fdescEn">
        <div>{{data.fdescEn}}</div>
      </el-form-item>
      <el-form-item label="solutionEn">
        <div>{{data.solutionEn}}</div>
      </el-form-item>
      <el-form-item label="titleSp">
        <div>{{data.titleSp}}</div>
      </el-form-item>
      <el-form-item label="fdescSp">
        <div>{{data.fdescSp}}</div>
      </el-form-item>

      <el-form-item label="solutionSp">
        <div>{{data.solutionSp}}</div>
      </el-form-item>


    </el-form>
  </div>
</template>

<script>
import {roomDetail} from "../../api/room";
import {faultcodeDetail} from "../../api/faultcode";

export default {
  name: "detail",
  data(){
    return{
      data:{}
    }
  },
  filters: {
    statusName(status) {
      if (status===1) {
        return '正常';
      }else{
        return '异常'
      }
    }
  },
  created() {
    this.getDetail(this.$route.query.id)
  },
  methods:{
    getDetail(id){
      faultcodeDetail({id:id}).then(response => {
        this.data = response.data.data
      })
    }
  }

}
</script>

<style scoped>

</style>
